Release 10.1A: OpenEdge Development:
Web Services


Creating server-side context for a ProcObject (running a persistent procedure)

Complete the steps that follow to create the server-side context for the ProcObject.

To create the context for a ProcObject on the AppServer:

  1. Run the persistent procedure, creating the ProcObject:
  2. orderInfo.createPO_CustomerOrder(3); 
    

    Caution: Now that the ProcObject is created, remember to release the object later, when it is no longer needed.

  3. Check to see if an object ID was returned:
  4. if (null == orderInfoControlBlock.getObjectNameID("CustomerOrder")) 
    { 
       throw new Exception("No header returned from a create operation    for 
    CustomerOrder.");  
    } 
    

  5. The CustomerOrderObjStub object is created from a factory method included in the OrderInfoObjStub object. Therefore, the PscObjectIDHandler bound to the OrderInfoObjStub locates and stores the object ID value for the CustomerOrderObjStub object in the OrderInfoObjStub object. Thus the client application must obtain (export) the object ID value for the CustomerOrderObjStub from the OrderInfoObjStub handler and insert (import) it into the CustomerOrderObjStub handler. For example:
  6. custOrderControlBlock.importObjectID("CustomerOrder",  
    orderInfoControlBlock.exportObjectID("CustomerOrder")); 
    

    This enables the CustomerOrderObjStub handler to automatically insert the CustomerOrder object ID into the headers for all SOAP requests made on the CustomerOrderObjStub object.

  7. The client application must then remove (release) the object ID value for the CustomerOrderObjStub object from the OrderInfoObjStub handler because it is no longer needed by that handler. For example:
  8. orderInfoControlBlock.releaseObjectNameID("CustomerOrder"); 
    


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095